// var fileHost = 'https://bmbj.oss-cn-shenzhen.aliyuncs.com/'; 
// var config = {
// 	uploadImageUrl: fileHost, // 默认存在根目录，可根据需求改
// 	AccessKeySecret: 'XIZ2XzEGYwEV4KbdHMacM2MX7MvgW3', // AccessKeySecret 去你的阿里云上控制台上找
// 	OSSAccessKeyId: 'LTAI5tAVc9dVRWqsn9bJNmsS', // AccessKeyId 去你的阿里云上控制台上找
// 	timeout: 87600 //这个是上传文件时Policy的失效时间
// }
import http from '../request/api/common';
export default class OSSConfig { 
	async getConfig() {
		return await this.setConfig();
	}
	async setConfig() {
		let res = await http.ststoken();
		let fileHost = `https://${res.data.bucket}.${res.data.region}.aliyuncs.com`
		this.config = {
			errorCode:200,
			uploadImageUrl: `${fileHost}`, // 默认存在根目录，可根据需求改 
			AccessKeySecret: res.data.accessKeySecret, // AccessKeySecret 去你的阿里云上控制台上找
			OSSAccessKeyId: res.data.accessKeyId, // AccessKeyId 去你的阿里云上控制台上找
			securityToken: res.data.securityToken, // securityToken 
			timeout: 87600 //这个是上传文件时Policy的失效时间
		}
		return this.config;
	} 
};